package com.beta.admin.controller;

import com.beta.common.web.ContentType;
import com.beta.dto.order.OrderItemDto;
import com.beta.service.IOrderItemsService;
import com.beta.service.IShipmentsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created by lichao on 2017/1/23.
 */
@RestController
@RequestMapping(value = RequestMappingConstants.MAPPING_PREFIX +"/orderItems")
public class OrderItemController {
    @Autowired
    private IOrderItemsService orderItemsService;
    @Autowired
    private IShipmentsService shipmentsService;
    @GetMapping(value = "/{orderId}",produces = ContentType.JSON)
    public Object getOrderItems(@PathVariable("orderId")Integer orderId){
        List<OrderItemDto> ordersItems = orderItemsService.getOrdersItemsByOrderId(orderId);
        return ordersItems;
    }
    @GetMapping(value = "/shipments/{orderId}")
    public Object getShipmentDetail(@PathVariable("orderId")Integer orderId){
        return null;
    }
}
